/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sistemperpustakaan.actionlistener;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import sistemperpustakaan.view.FrmMain;

/**
 *
 * @author Eko Aprianto
 */
public class MenuLookAndFeelActionListener implements ActionListener {
FrmMain frameMain;
    String laf = "";

    public MenuLookAndFeelActionListener() {
    }

    public MenuLookAndFeelActionListener(FrmMain frameMain) {
        this.frameMain = frameMain;
    }

    public void actionPerformed(ActionEvent e) {
        if(e.getSource()== frameMain.getRadioNimbuz()){
            laf="com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
        }else if(e.getSource()== frameMain.getRadioWindow()){
            laf="com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
        }else if(e.getSource()== frameMain.getRadioMetal()){
            laf="javax.swing.plaf.metal.MetalLookAndFeel";
        }else if(e.getSource()== frameMain.getRadioMotif()){
            laf="com.sun.java.swing.plaf.motif.MotifLookAndFeel";
        }
        try {
            UIManager.setLookAndFeel(laf);
            SwingUtilities.updateComponentTreeUI(frameMain);
        } catch (Exception ex) {
        }
    }

}
